import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vite.dev/config/
export default defineConfig({
  plugins: [vue()],
  server: {
    proxy: {
      '/api/account/create': 'http://localhost:3000',
      '/api/transaction/send': 'http://localhost:3000',
      // '/api/transaction/:txid': 'http://localhost:3000', // this doesn't work, 404 in web-browser
      '/api/transaction/': {
        target: 'http://localhost:3000',
        changeOrigin: true,
      },
      '/api/balance': 'http://localhost:3000',
      '/api/mine': 'http://localhost:3000',
      '/ws': {
        target: 'ws://localhost:3000',
        ws: true
      }
    }
  }
})